﻿@{
    ViewData["Title"] = "组织机构";
}

<div class="panel panel-default">
    <div class="form-content" data-toggle="form" data-field="GroupTree" data-detailable="true" data-loaded="#:IdentityResource.groupFormLoaded" style="padding: 35px 25px;">
        <div class="form-body col-md-offset-2 col-md-3 panel panel-default" style="padding:10px;margin-right:20px">
            <div class="form-heading">
                组织单位
                <button class="pull-right" data-button="add" data-popup="Edit">新增</button>
            </div>
            <div class="row">
                <div id="groupTree" class="k-widget k-treeview" style="padding:10px; max-height:680px;min-height:545px">
                </div>
            </div>
        </div>
        <div class="form-body col-md-5  panel panel-default" style="padding:10px;height:620px">
            <div class="form-heading">详情</div>
            <div id="detail" class="col-md-9" style="display:none;padding:10px;">
                <div data-field="image" data-title="组织图片" data-type="img" data-business-type="Group.Image" data-single="true"></div>
                <span data-field="parentName" data-title="父级组织"></span>
                <span data-field="name" data-title="组织名称"></span>
                <span data-field="alias" data-title="组织别名"></span>
                <span data-field="type" data-title="组织类型" data-data-from="cache.authorizeType"></span>
                <span data-field="state" data-title="状态" data-data-from="cache.dataState"></span>
                <span data-field="description" data-title="备注说明"></span>
                <div class="form-footer text-right">
                    <button data-button="edit" data-popup="Edit"></button>
                    <button data-button="delete" data-url="/api/Groups" data-success="#:IdentityResource.deleteRefreshTree"></button>
                </div>
            </div>
        </div>
    </div>
</div>

<div id="_PopupEdit" data-toggle="popup" data-type="Edit" data-title="组织机构信息" data-size="large">
    <div class="popup-content" data-toggle="form" data-field="Edit" data-editable="true" data-url="/api/Groups" data-size="12,3,7">
        <div class="popup-body">
            <div class="form-content">
                <div class="form-body">
                    <select data-field="parentId" data-title="父级组织" data-role="kendoDropDownList" data-side="server" data-url="/api/Groups?$select=Id,Name" data-data-value-field="id" data-data-text-field="name"></select>
                    <input data-field="name" data-title="组织名称" required />
                    <input data-field="alias" data-title="组织别名" />
                    <span data-field="type" data-title="组织类型" required type="radio" data-size="12,3,9" data-with-group="true" data-data="#:cache.authorizeType" data-value="Internal" data-data-value-field="value"></span>
                    <textarea data-field="description" data-title="备注说明" rows="3" data-multiple="true"></textarea>
                    <span data-field="state" data-title="状态" required type="radio" data-size="12,3,9" data-with-group="true" data-data="#:cache.dataState" data-value="Available"></span>
                    <input data-field="image" data-title="组织图片" data-with-attachments="true" data-business-type="Group.Image" data-single="true" type="file" data-role="kendoUpload" data-file-size="1024" data-file-extension=".jpg,.jpeg,.png" />
                </div>
            </div>
        </div>
        <div class="popup-footer text-right">
            <button data-button="post" data-success="#:IdentityResource.refreshTree"></button>
            <button data-button="put" data-success="#:IdentityResource.refreshTree"></button>
            <button data-button="close"></button>
        </div>
    </div>
</div>


<script src=~/js/identityResource.js asp-append-version="true"></script>